package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Daily;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;
import cn.wolfcode.trip.base.query.SearchQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DailyMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Daily record);

    Daily selectByPrimaryKey(Long id);

    List<Daily> selectAll();

    int updateByPrimaryKey(Daily record);

    List<Daily> queryForList(QueryObject qo);

    List<Daily> queryForApp(QueryObject qo);

    Daily selectHotDaily(Integer sequence);

    void updateBrowseNumById(Long id);

    void  updateHotDailyById(Long  id);

    int queryLikeCountByDailyId(Long dailyId);

    int queryIsLike(@Param("userId") Long userId, @Param("dailyId") Long dailyId);
    List<Daily> listForDaily(Long userId);//查询当前用户收藏的所有日报

    int queryForCount(SearchQueryObject qo);

    int getByDailyId(@Param("userId") Long userId, @Param("dailyId") Long dailyId);//判断当前用户是否收藏该日报

    void addCollection(@Param("userId") Long userId, @Param("dailyId") Long dailyId);//添加收藏

    void deleteCollection(@Param("userId") Long userId, @Param("dailyId") Long dailyId);//取消收藏

}